<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .active {
        text-decoration: underline;
    }
    .text-danger {
        font-weight: bold;
    }
</style>
<body>
    <script src="./js/vue.js"></script>
    <div id='app'>
      <div :class="isActive?'active':'text-danger'">hello school！</div>
    </div><!--根据三元表达式绑定样式，isActive为true执行active样式，否则执行text-danger样式-->
        <!--三元表达式后面类名需要加引号，不然报错-->
    <script>
        let app =new Vue({
             el:"#app",
             data:{
                isActive:true
             }
        })
    </script>
</body>
</html>